
function funa(){
    setTimeout(() => {
        console.log("A");
        iterator.next();
    }, 1000);
}
function funb(){
    setTimeout(() => {
        console.log("B");
        iterator.next();
    }, 1000);
}
function func(){
    setTimeout(() => {
        console.log("C");
    }, 1000);
}

function * gen(){
    yield funa();
    yield funb();
    yield func();
}

let iterator=gen();
iterator.next();